unit CommonData;

interface

uses
  SysUtils, Classes, uGoogleLogin, Dialogs, Options, Controls;

type
  TDataCtrls = class(TDataModule)
    GOptions: TOptions;
    procedure DataModuleCreate(Sender: TObject);
    procedure GOptionsOptionSet(Sender: TObject; CurrentOption: TOption);
    procedure GOptionsOptionApply(Sender: TObject; CurrentOption: TOption);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  DataCtrls: TDataCtrls;

implementation

{$R *.dfm}

uses auth_unit;

procedure TDataCtrls.DataModuleCreate(Sender: TObject);
begin
  GOptions.LoadAllOptions;
end;

procedure TDataCtrls.GOptionsOptionApply(Sender: TObject;
  CurrentOption: TOption);
begin
  with CurrentOption do
  begin
    if Ident = 'e-mail' then
      AuthForm.Edit1.Text := Value;
    if Ident = 'remember e-mail' then
    begin
      AuthForm.CheckBox1.Checked := Value;
      if Value then
        GOptions['e-mail'].Value := AuthForm.Edit1.Text
      else
        GOptions['e-mail'].Value := '';
    end;
  end;
end;

procedure TDataCtrls.GOptionsOptionSet(Sender: TObject; CurrentOption: TOption);
begin
  with CurrentOption do
  begin
  end;
end;

end.
